import java.util.Arrays;

public class BubbleSortTest {
    public static void main(String[] args) {
        int[] arr = {22, 34, 12, 666, 12, -19, 22, 33, 55, 11, 0, 1};
        bubbleSort(arr);
        printArray(arr);
    }

    private static void printArray(int[] arr) {
        for (int i : arr) {
            System.out.println(i);
        }
    }

    private static void bubbleSort(int[] arr) {
        for (int i = 0; i < arr.length - 1; i++) {
            for (int j = 0; j < arr.length - 1 - i; j++) {
                if (arr[j] > arr[j + 1]) {
                    int tmp = arr[j];
                    arr[j] = arr[j + 1];
                    arr[j + 1] = tmp;
                }
            }
        }
    }
}
